<!--
	作者：2575202388@qq.com
	时间：2018-10-14
	描述：首页我的信息
-->

<template>
    <Card :bordered="false" style="height:430px;">
        <p slot="title">
        	<Icon type="ios-pulse" style="color:#07a1be;font-size: 18px;"/>
        	<span style="padding-left:2px;font-weight: normal;">报名统计一</span>
        </p>
        <div style="width:100%;float:left;text-align: center;margin:0 auto;display:table;" align="center">	
      		<div ref="bar" style="width:100%;min-width: 600px; float:left;height:330px;"></div>
        </div>
    </Card>
</template>

<script>
	import echarts from 'echarts'
	export default {
		name:"homemyinfo",
		props: {
    		whk:{
    			type: Array
    		}
    	},
		mounted(){
		},
		methods: {
		    drawLine(){
		    	var whk=this.whk;
		    	var datas=[];
		    	var series=[];
		    	for(var i=0;i<whk.length;i++){
		    		datas.push(whk[i].MC);
		    		series.push(whk[i].COUNT1);
		    	}
			    // 基于准备好的dom，初始化echarts实例
			    const myChart = echarts.init(this.$refs.bar);
			    // 绘制图表
			    myChart.setOption({
		        	    toolbox: {
				        show: true,
				        feature: {
				            magicType: {type: ['line', 'bar']},
				            saveAsImage: {}
				        }
				    },
				    
				    xAxis: {
				        type: 'category',
				        data: datas
				    },
				    yAxis: {
				        type: 'value'
				    },
				    series: [{
				        data: series,
				        type: 'line'
				    }]
				    
		    	});
		    }
		},
		watch:{
			whk(news,olds){
				if(news){
					this.drawLine();
				}
			}
		},
	}
</script>

<style>

</style>



